package indi.zhifa.expshare.class001.mongodb.config;

import indi.zhifa.expshare.class001.mongodb.log.Slf4jCommandListener;
import org.springframework.boot.autoconfigure.mongo.MongoClientSettingsBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MongoLogConfig {
    @Bean
    public MongoClientSettingsBuilderCustomizer commandListenerCustomizer() {
        return builder -> builder.addCommandListener(new Slf4jCommandListener());
    }
}
